/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 响应区域样式 */
.response-section {
    flex: 1;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px); /* 固定高度 */
    max-height: calc(100vh - 40px);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.response-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.response-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #1e1e1e;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    height: 100%; /* 确保内容区域填充剩余空间 */
}

/* 配置区域样式 */
.config-section {
    width: 400px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.url-input {
    margin-bottom: 10px;
}

.url-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 请求头配置样式 */
.headers-section {
    margin-bottom: 10px;
}

.header-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.header-key, .header-value {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 0; /* 防止内容溢出 */
}

.remove-header {
    padding: 8px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

/* 请求体配置样式 */
.body-section {
    margin-bottom: 10px;
}

#requestBody {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    resize: vertical;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    
    .config-section {
        width: 100%;
    }
    
    .response-section {
        min-height: 500px;
    }
}

/* 流式响应动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.response-content div {
    animation: fadeIn 0.3s ease-out;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 0;
}

/* 滚动条样式 */
.response-content::-webkit-scrollbar {
    width: 8px;
}

.response-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.response-content::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.response-content::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Loading 动画 */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 